<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:f="http://xmlns.jcp.org/jsf/core"
	xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
	xmlns:c="http://xmlns.jcp.org/jsf/composite"
	xmlns:p="http://primefaces.org/ui">
<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta http-equiv="Pragma" content="no-cache" />
	<meta http-equiv="Expires" content="-1" />
	<title>ST Manager</title>
	<link href="imagem/favicon.png" type="image/png" rel="shortcut icon" />
	<link type="text/css" rel="stylesheet"
		href="#{request.contextPath}/css/skytef.css" />
</h:head>
<h:body>
	<ui:include src="header.xhtml" />
	<div class="central">
		<h:form id="form">
			<p:panel id="conteudo" header="Informações da Tarefa: "
				style="width: 97.5%;">
				<p:messages />
				<h:outputText value="Nº Tarefa: OCR #{TarefaBean.tarefa.id}" />
				<h:panelGrid id="displaya" columns="6" cellpadding="4"
					style="margin:0 auto;">
					<h:outputText value="CNPJ/Razão Social/Id Skytef: "
						style="font-size: 14px;font-weight:bold;" />
					<p:inputText id="maskcnpj" value="#{TarefaBean.textoConsulta}"
						required="true" requiredMessage="Cliente obrigatório" />
					<h:outputText value="Contato: "
						style="font-size: 14px; font-weight:bold;" />
					<p:selectOneMenu value="#{TarefaBean.tarefa.contato_id}">>
						<f:selectItems value="#{TarefaBean.contatos}" var="contatos"
							itemLabel="#{contatos.nome}" itemValue="#{contatos.contatoId}"
							style="font-size: 10px;" />
					</p:selectOneMenu>

					<p:commandButton icon="ui-icon-plus" update="form:clientePanel"
						oncomplete="PF('clienteDialog').show()"
						actionListener="#{TarefaBean.cadContato}" style="font-size: 14px;" />
					<p:commandButton ajax="false" icon="ui-icon-search"
						update="form:clientePanel" action="#{TarefaBean.localizarContato}"
						style="font-size: 14px;" />
				</h:panelGrid>
				<h:panelGrid columns="4" cellpadding="4" style="margin:0 auto;">
					<h:outputText value="Motivo Suporte: "
						style="font-size: 14px; font-weight:bold;" />
					<p:selectOneMenu value="#{TarefaBean.tarefa.motivoSuporte_id}">>
						<f:selectItems
							value="#{TarefaBean. getListMotivoSuporteEntities()}" var="mot"
							itemLabel="#{mot.motivo}" itemValue="#{mot.id}"
							style="font-size: 10px;" />
					</p:selectOneMenu>
					<p:commandButton icon="ui-icon-plus" update="form:motivoDlg"
						oncomplete="PF('motivoDialog').show()" style="font-size: 14px;" />

					<p:commandButton ajax="false" value="Abrir Tarefa"
						icon="ui-icon-plus" update="form:clientePanel"
						actionListener="#{TarefaBean.localizar}" style="font-size: 14px;" />


				</h:panelGrid>
			</p:panel>

			 <p:dialog header="Cadastro de Contato" widgetVar="clienteDialog"
				resizable="false" id="clienteDlg" showEffect="fade"
				hideEffect="explode" modal="true">
				<h:panelGrid columns="2" cellpadding="4">
					<h:outputText value="Nome: "
						style="font-size: 14px;font-weight:bold; " />
					<h:inputText value="#{ContatoBean.nome}"
						style="font-weight:bold; font-size: 14px;" />
					<h:outputText value="Telefone: "
						style="font-size: 14px;font-weight:bold;" />
					<p:inputText value="#{ContatoBean.telefone}"
						style="font-weight:bold; font-size: 14px; " />
					<h:outputText value="Email: "
						style="font-size: 14px;font-weight:bold;" />
					<p:inputText value="#{ContatoBean.email}"
						style="font-weight:bold; font-size: 14px; " />
					<p:commandButton ajax="false" value="Salvar" icon="ui-icon-plus"
						update="form:clientePanel"
						actionListener="#{ContatoBean.cadastro}" style="font-size: 14px;" />
				</h:panelGrid>
			</p:dialog>


			<p:dialog header="Cadastro de Motivo" widgetVar="motivoDialog"
				resizable="false" id="motivoDlg" showEffect="fade"
				hideEffect="explode" modal="true">
				<h:panelGrid columns="2" cellpadding="4">
					<h:outputText value="Motivo: "
						style="font-size: 14px;font-weight:bold; " />
					<h:inputText value="#{TarefaBean.motivo}"
						style="font-weight:bold; font-size: 14px;" />
					<p:commandButton value="Cadastrar" icon="ui-icon-plus"
						update="form:clientePanel" ajax="false"
						actionListener="#{TarefaBean.cadastrarMotivo}"
						style="font-size: 14px;" />
				</h:panelGrid>
			</p:dialog>

			<p:panel resizable="false" id="clientePanel"
				visible="#{TarefaBean.atendimento}"
				style="width: 97.5%; margin-top:10px;" ajax="false">
				<h:panelGrid id="display" columns="6" cellpadding="4"
					style="margin:0 auto;">
					<h:outputText value="Razão Social: "
						style="font-size: 14px;font-weight:bold;" />
					<h:outputText value="#{TarefaBean.cliente.razaoSocial}"
						style="font-weight:bold; font-size: 14px; " />
					<h:outputText value="Revenda: "
						style="font-size: 14px;font-weight:bold;" />
					<h:outputText value="#{TarefaBean.parceiro.nomeFantasia}"
						style="font-weight:bold; font-size: 14px;" />

					<h:outputText value="Software House: "
						style="font-size: 14px;font-weight:bold;" />
					<h:outputText value="#{TarefaBean.sftHouse.nome}"
						style="font-weight:bold; font-size: 14px; " />
				</h:panelGrid>
				<h:panelGrid columns="6" cellpadding="6" style="margin:0 auto;">
					<h:outputText value="Tipo de VPN: "
						style="font-size: 14px;font-weight:bold;" />
					<h:outputText value="#{TarefaBean.prodCliente.tipoVpn}"
						style="font-weight:bold; font-size: 14px; " />
					<h:outputText value="Produto: "
						style="font-size: 14px;font-weight:bold;" />
					<h:outputText value="#{TarefaBean.produto.nome}"
						style="font-weight:bold; font-size: 14px; " />
				</h:panelGrid>
				<h:panelGrid columns="6" cellpadding="4" style="margin:0 auto;">
					<h:outputText value=" Tipo Cliente: "
						style="font-size: 14px;font-weight:bold;" />
					<p:selectOneMenu id="tipoCliente" style="font-size: 12px;"
						value="#{TarefaBean.tarefa.tipoCliente}">
						<f:selectItem itemLabel="Cliente" itemValue="C" />
						<f:selectItem itemLabel="Revenda" itemValue="R" />
					</p:selectOneMenu>
					<h:outputText value=" Forma: "
						style="font-size: 14px; font-weight:bold;" />
					<p:selectOneMenu value="#{TarefaBean.tarefa.forma}"
						style="font-size: 12px">
						<f:selectItem itemLabel="Acesso Remoto" itemValue="R" />
						<f:selectItem itemLabel="Telefônico" itemValue="T" />
						<f:selectItem itemLabel="A/T" itemValue="2" />
					</p:selectOneMenu>
					<h:outputText value=" Tipo de Suporte: "
						style="font-size: 14px; font-weight:bold;" />
					<p:selectOneMenu id="tipoSuporte" style="font-size: 12px;"
						value="#{TarefaBean.tarefa.tipoSuporte}">
						<f:selectItem itemLabel="Instalação" itemValue="I" />
						<f:selectItem itemLabel="Atendimento" itemValue="A" />
						<f:selectItem itemLabel="Skype" itemValue="S" />
						<f:selectItem itemLabel="Email" itemValue="E" />
					</p:selectOneMenu>
				</h:panelGrid>
				<h:panelGrid id="displass" columns="4" cellpadding="4"
					style="margin:0 auto;">
					<h:outputText value="Subcategorias de Erros: "
						style="font-size: 14px; font-weight:bold;" />
					<p:selectOneMenu value="#{TarefaBean.tarefa.suberro_id}">
						<f:selectItems value="#{TarefaBean. getListSubErroEntities()}"
							var="erro" itemLabel="#{erro.nome}" itemValue="#{erro.id}"
							style="font-size: 10px;" />
					</p:selectOneMenu>
				</h:panelGrid>
				<h:panelGrid id="ds" columns="4" cellpadding="4">
					<h:outputText value="Descrição do Atendimento: "
						style="font-size: 14px;font-weight:bold;" />
					<p:inputTextarea rows="10" cols="80" style="font-size: 14px;"
						value="#{TarefaBean.tarefa.descricao}" />
					<h:outputText value="Status: "
						style="font-size: 14px;font-weight:bold;" />
					<p:selectOneMenu id="status" style="font-size: 14px;"
						value="#{TarefaBean.tarefa.status}">
						<f:selectItem itemLabel="Pendente" itemValue="P" />
						<f:selectItem itemLabel="Concluído" itemValue="C" />
					</p:selectOneMenu>
				</h:panelGrid>

				<div style="margin-top: 14px; margin-left: 80%">
					<p:commandButton id="btSalvar" value="Salvar"
						style="font-size: 14px;" image="ui-icon-disk" ajax="false"
						actionListener="#{TarefaBean.salvar}" />
					<p:commandButton id="btLimpar" value="Limpar"
						style="font-size: 14px;" image="ui-icon-disk" ajax="false"
						actionListener="#{TarefaBean.limpar}" update="form:btLimpar" />
				</div>
			</p:panel>
		</h:form>
	</div>

		<p:panel id="cm" style="background: transparent; border: 0px;">
			<ui:include src="#{DashboardBean.currentMenu}" />
		</p:panel>
		<p:panel id="cr" style="background: transparent; border: 0px;">
			<ui:include src="#{DashboardBean.currentRodape}" />
		</p:panel>

</h:body>
</html>

